﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;
using System.Web.Routing;
using System.Web.Security;
using System.Web.SessionState;

namespace WebActiveRecord
{
    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            // 在应用程序启动时运行的代码
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            string path = Server.MapPath("~") + "\\" + "config\\";
            Castle.ActiveRecord.Framework.IConfigurationSource config = new Castle.ActiveRecord.Framework.Config.XmlConfigurationSource(path + "ActiveRecord.config");
            Castle.ActiveRecord.ActiveRecordStarter.Initialize(System.Reflection.Assembly.Load("MonitoringSystem.DBModel"), config);
           
        }
    }
}